package com.luoran.bartalks.service.impl;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luoran.bartalks.dao.IBtPositionDao;
import com.luoran.bartalks.entity.BaseInfo;
import com.luoran.bartalks.entity.biz.BtPosition;
import com.luoran.bartalks.service.IBtPositionService;

@Service
public class BtPositionService implements IBtPositionService {

	@Autowired
	private IBtPositionDao dao;

	@Override
	public PageQuery<? extends BaseInfo> getQueryList(PageQuery<? extends BaseInfo> pageQuery) {
		 dao.queryPage(pageQuery);
		return pageQuery;
	}

	@Override
	public List<BtPosition> getPositionByCompanyId(String companyId) {
		return dao.getPositionByCompanyId(companyId);
	}


	@Override
	public BtPosition getPositByPositionCode(String PositionCode, String companyId) {
		return dao.getPositByPositionCode(PositionCode, companyId);
	}

	@Override
	public BtPosition addPosit(BtPosition position) {
		 dao.insert(position);
		 return position;
	}

	@Override
	public void editPosition(BtPosition position) {
		dao.updateTemplateById(position);
	}

	@Override
	public BtPosition getPositionById(String id) {
		return dao.single(id);
	}

	@Override
	public List<BtPosition> getPositByParentRegPositionCode(String parentRegPositionCode, String companyId) {
		return dao.getPositByParentRegPositionCode(parentRegPositionCode, companyId);
	}

	@Override
	public List<BtPosition> getpositsBylongCode(String regcode,String CompanyId) {
		return dao.getpositsBylongCode(regcode, CompanyId);
	}

	@Override
	public List<BtPosition> getPositsByReigs(String[] regionCodes, String CompanyId) {
		return dao.getPositsByReigs(regionCodes, CompanyId);
	}
     
}
